# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Oliver Smith <ollieparanoid@postmarketos.org>
pkgname=pmbootstrap
pkgver=2.2.1
pkgrel=1
pkgdesc="Sophisticated chroot/build/flash tool to develop and install postmarketOS"
url="https://sr.ht/~postmarketos/pmbootstrap/"
arch="noarch"
license="GPL-3.0-or-later"
depends="
	git
	openssl
	python3
	"
makedepends="py3-gpep517 py3-setuptools py3-wheel python3-dev"
checkdepends="pytest"
subpackages="$pkgname-pyc"
source="https://gitlab.com/postmarketOS/pmbootstrap/-/archive/$pkgver/pmbootstrap-$pkgver.tar.bz2
	modules-load.conf
	"
install="$pkgname.post-install"
options="!check" # Tests require chroot etc.

build() {
	gpep517 build-wheel \
		--wheel-dir dist \
		--output-fd 3 3>&1 >&2
}

package() {
	python3 -m installer -d "$pkgdir" \
		dist/*.whl
	install -Dm644 "$srcdir"/modules-load.conf "$pkgdir"/usr/lib/modules-load.d/pmbootstrap.conf
}

sha512sums="
25c517f8624663c87008e78fa352a2661de15c9468b24c9a75e3b6fab07acdda178268c8554d44affecd1f72c2a737c89fc6dadf823d0d67b6def5a051b0d501  pmbootstrap-2.2.1.tar.bz2
f8026ab32234b885e69252459047f70160c54319113bc449000aa7c05bd016f00a46cee05c8f5251682f967ab44a12c06fbbb3c02d0a57ccb836cff810ce1a40  modules-load.conf
"
